package com.example.blogindex.web;

import com.example.blogindex.web.Fengin.OtherFengin;
import com.xpd.blog.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.OffsetTime;

@RestController
@RequestMapping("fired")
public class FiredController {
    @Autowired
    OtherFengin otherFengin;
    @RequestMapping("guan")
    public Result guan(@RequestParam int usid, @RequestParam int uid){
        Result guan = otherFengin.guan(usid, uid);
        System.out.println("guan = " + guan);
        return guan;
    }
    //关注博主
    @RequestMapping("guanzhu")
    public Result guanzhu(@RequestParam int usid,@RequestParam int uid){
        Result guanzhu = otherFengin.guanzhu(usid, uid);
        return guanzhu;
    }
    //取消关注
    @RequestMapping("quguanzhu")
    public Result  quguanzhu(@RequestParam int usid,@RequestParam int uid){
        Result quguanzhu = otherFengin.quguanzhu(usid, uid);
        return quguanzhu;
    }
    //查看自己的粉丝
    @RequestMapping("getFans")
    public Result getFans(@RequestParam int usid){
        Result fans = otherFengin.getFans(usid);
        return fans;
    }
    //查看自己的关注
    @RequestMapping("getAttention")
    public Result getAttention(@RequestParam int usid){
        Result attention = otherFengin.getAttention(usid);
        return attention;
    }
    //查看关注自己用户的详细信息
    @RequestMapping("getAllFans")
    public Result getAllFans(@RequestParam int usid,@RequestParam int page,@RequestParam int size){
        Result allFans = otherFengin.getAllFans(usid, page, size);
        return allFans;
    }
    //查看自己关注的人的详细信息
    @RequestMapping("getAllAttention")
    public Result getAllAttention(@RequestParam int usid,@RequestParam int page,@RequestParam int size){
        Result allAttention = otherFengin.getAllAttention(usid, page, size);
        return allAttention;
    }
    //查找粉丝数量前六的博主
    @RequestMapping("selectfired")
    public Result selectfired(@RequestParam int usid){
        Result selectfired = otherFengin.selectfired(usid);
        return selectfired;
    }

}
